{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\au448989\OneDrive - Aarhus Universitet\Projekter\Submissions\Electoral Malpractice, Partisanship, and Attitudes\Revision_BJPS\Revision No. 2\Replication files\analysis_log.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}23 Feb 2022, 14:44:52

{com}. do "C:\Users\au448989\AppData\Local\Temp\STD4448_000000.tmp"
{txt}
{com}. 
. clear all
{res}{txt}
{com}. use "C:\Users\au448989\OneDrive - Aarhus Universitet\Projekter\Submissions\Electoral Malpractice, Partisanship, and Attitudes\Revision_BJPS\Revision No. 2\Replication files\replication_data.dta", clear 
{txt}
{com}. set scheme plotplain 
{txt}
{com}. 
. 
. ***************************************
. ******** FIGURES IN MAIN TEXT *********
. ***************************************
. 
. *** Figure 1
. ** Please note that the text in graphs are taken from the regression output
. 
. * PEI
. quietly reg pei i.treatment if country == 0 & sample ==1, robust // DK
{txt}
{com}. margins treatment
{res}
{txt}{col 1}Adjusted predictions{col 58}{lalign 13:Number of obs}{col 71} = {res}{ralign 5:1,915}
{txt}{col 1}Model VCE: {res:Robust}

{txt}{p2colset 1 13 13 2}{...}
{p2col:Expression:}{res:Linear prediction, predict()}{p_end}
{p2colreset}{...}

{res}{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26} Delta-method
{col 14}{c |}     Margin{col 26}   std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 3}treatment {c |}
{space 4}Control  {c |}{col 14}{res}{space 2} 4.186099{col 26}{space 2} .0508376{col 37}{space 1}   82.34{col 46}{space 3}0.000{col 54}{space 4} 4.086396{col 67}{space 3} 4.285802
{txt}{space 4}Treated  {c |}{col 14}{res}{space 2} 1.588155{col 26}{space 2}  .029071{col 37}{space 1}   54.63{col 46}{space 3}0.000{col 54}{space 4} 1.531141{col 67}{space 3} 1.645169
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. marginsplot, ///
>    recast(bar) plotop(fcolor(white) lcolor(black)) ///
>    xlabel(,nogrid) ylabel(1 2 3 4 5, nogrid) ytitle("Election Fairness") xtitle("") title("") legend(off) ///
>    text(3.8 1 "Difference = -2.60***") text(3.6 1 "SE = 0.06") text(3.4 1 "P value < 0.001") name(dk_1)
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:treatment}{p_end}
{res}{txt}
{com}. 
. quietly reg pei i.treatment if country == 1 & sample ==1, robust // MX
{txt}
{com}. margins treatment
{res}
{txt}{col 1}Adjusted predictions{col 58}{lalign 13:Number of obs}{col 71} = {res}{ralign 5:2,059}
{txt}{col 1}Model VCE: {res:Robust}

{txt}{p2colset 1 13 13 2}{...}
{p2col:Expression:}{res:Linear prediction, predict()}{p_end}
{p2colreset}{...}

{res}{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26} Delta-method
{col 14}{c |}     Margin{col 26}   std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 3}treatment {c |}
{space 4}Control  {c |}{col 14}{res}{space 2} 3.177866{col 26}{space 2} .0648582{col 37}{space 1}   49.00{col 46}{space 3}0.000{col 54}{space 4} 3.050671{col 67}{space 3}  3.30506
{txt}{space 4}Treated  {c |}{col 14}{res}{space 2} 1.943979{col 26}{space 2} .0345136{col 37}{space 1}   56.33{col 46}{space 3}0.000{col 54}{space 4} 1.876294{col 67}{space 3} 2.011665
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. marginsplot, ///
>    recast(bar) plotop(fcolor(white) lcolor(black)) ///
>    xlabel(, nogrid) ylabel(1 2 3 4 5, nogrid) ytitle("Election Fairness") xtitle("") title("",) legend(off) ///
>    text(3.8 1 "Difference = -1.23***") text(3.6 1 "SE = 0.07") text(3.4 1 "P value < 0.001") name(mx_1)
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:treatment}{p_end}
{res}{txt}
{com}. 
. * Support
. quietly reg support i.treatment if country == 0 & sample ==1, robust // DK
{txt}
{com}. margins treatment
{res}
{txt}{col 1}Adjusted predictions{col 58}{lalign 13:Number of obs}{col 71} = {res}{ralign 5:1,915}
{txt}{col 1}Model VCE: {res:Robust}

{txt}{p2colset 1 13 13 2}{...}
{p2col:Expression:}{res:Linear prediction, predict()}{p_end}
{p2colreset}{...}

{res}{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26} Delta-method
{col 14}{c |}     Margin{col 26}   std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 3}treatment {c |}
{space 4}Control  {c |}{col 14}{res}{space 2}  5.55157{col 26}{space 2} .1479627{col 37}{space 1}   37.52{col 46}{space 3}0.000{col 54}{space 4} 5.261384{col 67}{space 3} 5.841755
{txt}{space 4}Treated  {c |}{col 14}{res}{space 2} 1.779442{col 26}{space 2} .0680701{col 37}{space 1}   26.14{col 46}{space 3}0.000{col 54}{space 4} 1.645942{col 67}{space 3} 1.912941
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. marginsplot, ///
>    recast(bar) plotop(fcolor(white) lcolor(black)) ///
>    xlabel(, nogrid) ylabel(1 2 3 4 5 6 7 8 9 10, nogrid) ytitle("Government Support") xtitle("") title("") legend(off) ///
>    text(5.8 1 "Difference = -3.77***") text(5.4 1 "SE = 0.16") text(5 1 "P value < 0.001") name(dk_2)
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:treatment}{p_end}
{res}{txt}
{com}. 
. quietly reg support i.treatment if country == 1 & sample ==1, robust // MX
{txt}
{com}. margins treatment
{res}
{txt}{col 1}Adjusted predictions{col 58}{lalign 13:Number of obs}{col 71} = {res}{ralign 5:2,059}
{txt}{col 1}Model VCE: {res:Robust}

{txt}{p2colset 1 13 13 2}{...}
{p2col:Expression:}{res:Linear prediction, predict()}{p_end}
{p2colreset}{...}

{res}{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26} Delta-method
{col 14}{c |}     Margin{col 26}   std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 3}treatment {c |}
{space 4}Control  {c |}{col 14}{res}{space 2} 4.743083{col 26}{space 2} .1570212{col 37}{space 1}   30.21{col 46}{space 3}0.000{col 54}{space 4} 4.435146{col 67}{space 3}  5.05102
{txt}{space 4}Treated  {c |}{col 14}{res}{space 2} 2.740502{col 26}{space 2}  .082422{col 37}{space 1}   33.25{col 46}{space 3}0.000{col 54}{space 4} 2.578863{col 67}{space 3} 2.902141
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. marginsplot, ///
>    recast(bar) plotop(fcolor(white) lcolor(black)) ///
>    xlabel(, nogrid) ylabel(1 2 3 4 5 6 7 8 9 10, nogrid) ytitle("Government Support") xtitle("") title("") legend(off) ///
>    text(5.8 1 "Difference = -2.00***") text(5.4 1 "SE = 0.17") text(5 1 "P value < 0.001") name(mx_2)
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:treatment}{p_end}
{res}{txt}
{com}. 
. * Legitimacy
. quietly reg legitimacy i.treatment if country == 0 & sample ==1, robust // DK
{txt}
{com}. margins treatment
{res}
{txt}{col 1}Adjusted predictions{col 58}{lalign 13:Number of obs}{col 71} = {res}{ralign 5:1,915}
{txt}{col 1}Model VCE: {res:Robust}

{txt}{p2colset 1 13 13 2}{...}
{p2col:Expression:}{res:Linear prediction, predict()}{p_end}
{p2colreset}{...}

{res}{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26} Delta-method
{col 14}{c |}     Margin{col 26}   std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 3}treatment {c |}
{space 4}Control  {c |}{col 14}{res}{space 2} 3.928251{col 26}{space 2} .0502477{col 37}{space 1}   78.18{col 46}{space 3}0.000{col 54}{space 4} 3.829705{col 67}{space 3} 4.026797
{txt}{space 4}Treated  {c |}{col 14}{res}{space 2} 1.788972{col 26}{space 2}  .029755{col 37}{space 1}   60.12{col 46}{space 3}0.000{col 54}{space 4} 1.730616{col 67}{space 3} 1.847328
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. marginsplot, ///
>    recast(bar) plotop(fcolor(white) lcolor(black)) ///
>    xlabel(,nogrid) ylabel(1 2 3 4 5, nogrid) ytitle("Government Legitimacy") xtitle("") title("") legend(off) ///
>    text(3.8 1 "Difference = -2.14***") text(3.6 1 "SE = 0.06") text(3.4 1 "P value < 0.001") name(dk_3)
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:treatment}{p_end}
{res}{txt}
{com}. 
. quietly reg legitimacy i.treatment if country == 1 & sample ==1, robust // MX
{txt}
{com}. margins treatment
{res}
{txt}{col 1}Adjusted predictions{col 58}{lalign 13:Number of obs}{col 71} = {res}{ralign 5:2,059}
{txt}{col 1}Model VCE: {res:Robust}

{txt}{p2colset 1 13 13 2}{...}
{p2col:Expression:}{res:Linear prediction, predict()}{p_end}
{p2colreset}{...}

{res}{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26} Delta-method
{col 14}{c |}     Margin{col 26}   std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 3}treatment {c |}
{space 4}Control  {c |}{col 14}{res}{space 2} 3.065217{col 26}{space 2} .0581474{col 37}{space 1}   52.71{col 46}{space 3}0.000{col 54}{space 4} 2.951183{col 67}{space 3} 3.179251
{txt}{space 4}Treated  {c |}{col 14}{res}{space 2} 2.402447{col 26}{space 2} .0336079{col 37}{space 1}   71.48{col 46}{space 3}0.000{col 54}{space 4} 2.336538{col 67}{space 3} 2.468356
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. marginsplot, ///
>    recast(bar) plotop(fcolor(white) lcolor(black)) ///
>    xlabel(,  nogrid) ylabel(1 2 3 4 5, nogrid) ytitle("Government Legitimacy") xtitle("") title("") legend(off) ///
>    text(3.8 1 "Difference = -0.66***") text(3.6 1 "SE = 0.07") text(3.4 1 "P value < 0.001") name(mx_3)
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:treatment}{p_end}
{res}{txt}
{com}. 
. 
. graph combine dk_1 dk_2 dk_3, rows(1) name(dk_ate) title("Denmark") 
{res}{txt}
{com}. graph combine mx_1 mx_2 mx_3, rows(1) name(mx_ate) title("Mexico") 
{res}{txt}
{com}. graph combine dk_ate mx_ate, rows(2) name(fig1) plotregion(lcolor(black) lwidth(medium))
{res}{txt}
{com}. 
. graph drop dk_1 dk_2 dk_3 mx_1 mx_2 mx_3 dk_ate mx_ate
{txt}
{com}. 
. *** FIGURE 2 
. **PEI
. 
. quietly reg pei i.treatment##i.perp_support if country == 0 & sample ==1, robust // DK
{txt}
{com}. margins, dydx(treatment) at(perp_support=(1(1)5))
{res}
{txt}{col 1}Conditional marginal effects{col 58}{lalign 13:Number of obs}{col 71} = {res}{ralign 5:1,880}
{txt}{col 1}Model VCE: {res:Robust}

{txt}{p2colset 1 13 13 2}{...}
{p2col:Expression:}{res:Linear prediction, predict()}{p_end}
{p2col:dy/dx wrt:}{res:1.treatment}{p_end}
{p2colreset}{...}
{lalign 7:1._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:1}}
{lalign 7:2._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:2}}
{lalign 7:3._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:3}}
{lalign 7:4._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:4}}
{lalign 7:5._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:5}}

{res}{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26} Delta-method
{col 14}{c |}      dy/dx{col 26}   std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}{res}0.treatment {col 14}{txt}{c |}  (base outcome)
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}1.treatment  {txt}{c |}
{space 9}_at {c |}
{space 10}1  {c |}{col 14}{res}{space 2}-2.130159{col 26}{space 2} .1950346{col 37}{space 1}  -10.92{col 46}{space 3}0.000{col 54}{space 4}-2.512667{col 67}{space 3} -1.74765
{txt}{space 10}2  {c |}{col 14}{res}{space 2}-2.741551{col 26}{space 2} .1206164{col 37}{space 1}  -22.73{col 46}{space 3}0.000{col 54}{space 4}-2.978107{col 67}{space 3}-2.504994
{txt}{space 10}3  {c |}{col 14}{res}{space 2}-2.744146{col 26}{space 2} .1126594{col 37}{space 1}  -24.36{col 46}{space 3}0.000{col 54}{space 4}-2.965097{col 67}{space 3}-2.523195
{txt}{space 10}4  {c |}{col 14}{res}{space 2}-2.722234{col 26}{space 2} .0934294{col 37}{space 1}  -29.14{col 46}{space 3}0.000{col 54}{space 4} -2.90547{col 67}{space 3}-2.538997
{txt}{space 10}5  {c |}{col 14}{res}{space 2}-2.155975{col 26}{space 2} .1607837{col 37}{space 1}  -13.41{col 46}{space 3}0.000{col 54}{space 4}-2.471309{col 67}{space 3}-1.840641
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{p 0 6 0 78}Note: dy/dx for factor levels is the discrete change from the base level.{txt}{p_end}
{res}{txt}
{com}. marginsplot, ///
>   recast(scatter) ///
>   plotop(fcolor(white) lcolor(black) mlabel(_margin) mlabformat(%5.2fc) mlabsize(vsmall)) ///
>   title("") ///
>   xtitle("") ytitle("Election Fairness") ///
>   xlabel(1 "Strong Out-partisan" 3 "Neutral" 5 "Strong Co-partisan", nogrid) ///
>   ylabel(0 (.5) -3.5, nogrid) ///
>   graphregion(color(white)) ///
>   addplot(hist perp_support if country==0, discrete yaxis(2) yscale(off axis(2)) fcolor(gs10%10) lcolor(black%50 size(small)) legend(off)) name(dk_1)
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:perp_support}{p_end}
{res}{txt}
{com}.   
. *Mexico
. quietly reg pei i.treatment##i.perp_support if country == 1 & sample ==1, robust // MX
{txt}
{com}. margins, dydx(treatment) at(perp_support=(1(1)5))
{res}
{txt}{col 1}Conditional marginal effects{col 58}{lalign 13:Number of obs}{col 71} = {res}{ralign 5:1,996}
{txt}{col 1}Model VCE: {res:Robust}

{txt}{p2colset 1 13 13 2}{...}
{p2col:Expression:}{res:Linear prediction, predict()}{p_end}
{p2col:dy/dx wrt:}{res:1.treatment}{p_end}
{p2colreset}{...}
{lalign 7:1._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:1}}
{lalign 7:2._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:2}}
{lalign 7:3._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:3}}
{lalign 7:4._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:4}}
{lalign 7:5._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:5}}

{res}{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26} Delta-method
{col 14}{c |}      dy/dx{col 26}   std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}{res}0.treatment {col 14}{txt}{c |}  (base outcome)
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}1.treatment  {txt}{c |}
{space 9}_at {c |}
{space 10}1  {c |}{col 14}{res}{space 2}-.8037477{col 26}{space 2} .1113889{col 37}{space 1}   -7.22{col 46}{space 3}0.000{col 54}{space 4}-1.022199{col 67}{space 3}-.5852963
{txt}{space 10}2  {c |}{col 14}{res}{space 2}-1.249591{col 26}{space 2}  .190895{col 37}{space 1}   -6.55{col 46}{space 3}0.000{col 54}{space 4}-1.623966{col 67}{space 3}-.8752151
{txt}{space 10}3  {c |}{col 14}{res}{space 2}-1.281472{col 26}{space 2} .1492079{col 37}{space 1}   -8.59{col 46}{space 3}0.000{col 54}{space 4}-1.574092{col 67}{space 3}-.9888511
{txt}{space 10}4  {c |}{col 14}{res}{space 2}-1.552158{col 26}{space 2} .1630736{col 37}{space 1}   -9.52{col 46}{space 3}0.000{col 54}{space 4}-1.871972{col 67}{space 3}-1.232345
{txt}{space 10}5  {c |}{col 14}{res}{space 2}-1.601818{col 26}{space 2} .1750671{col 37}{space 1}   -9.15{col 46}{space 3}0.000{col 54}{space 4}-1.945153{col 67}{space 3}-1.258484
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{p 0 6 0 78}Note: dy/dx for factor levels is the discrete change from the base level.{txt}{p_end}
{res}{txt}
{com}. marginsplot, ///
>   recast(scatter) ///
>   plotop(fcolor(white) lcolor(black) mlabel(_margin) mlabformat(%5.2fc) mlabsize(vsmall)) ///
>   title("") ///
>   xtitle("") ytitle("Election Fairness") ///
>   xlabel(1 "Strong Out-partisan" 3 "Neutral" 5 "Strong Co-partisan", nogrid) ///
>   ylabel(0 (.5) -3.5, nogrid) ///
>   graphregion(color(white)) ///
>   addplot(hist perp_support if country==1, discrete yaxis(2) yscale(off axis(2)) fcolor(gs10%10) lcolor(black%50 size(small)) legend(off)) name(mx_1)
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:perp_support}{p_end}
{res}{txt}
{com}. 
. 
. ***Government Support
. *Denmark
. quietly reg support i.treatment##i.perp_support if country == 0 & sample==1, robust // DK
{txt}
{com}. margins, dydx(treatment) at(perp_support=(1(1)5))
{res}
{txt}{col 1}Conditional marginal effects{col 58}{lalign 13:Number of obs}{col 71} = {res}{ralign 5:1,880}
{txt}{col 1}Model VCE: {res:Robust}

{txt}{p2colset 1 13 13 2}{...}
{p2col:Expression:}{res:Linear prediction, predict()}{p_end}
{p2col:dy/dx wrt:}{res:1.treatment}{p_end}
{p2colreset}{...}
{lalign 7:1._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:1}}
{lalign 7:2._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:2}}
{lalign 7:3._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:3}}
{lalign 7:4._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:4}}
{lalign 7:5._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:5}}

{res}{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26} Delta-method
{col 14}{c |}      dy/dx{col 26}   std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}{res}0.treatment {col 14}{txt}{c |}  (base outcome)
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}1.treatment  {txt}{c |}
{space 9}_at {c |}
{space 10}1  {c |}{col 14}{res}{space 2}-.8340136{col 26}{space 2} .2759887{col 37}{space 1}   -3.02{col 46}{space 3}0.003{col 54}{space 4}-1.375292{col 67}{space 3}-.2927353
{txt}{space 10}2  {c |}{col 14}{res}{space 2}-3.017247{col 26}{space 2}  .247899{col 37}{space 1}  -12.17{col 46}{space 3}0.000{col 54}{space 4}-3.503435{col 67}{space 3} -2.53106
{txt}{space 10}3  {c |}{col 14}{res}{space 2} -4.35772{col 26}{space 2} .2486654{col 37}{space 1}  -17.52{col 46}{space 3}0.000{col 54}{space 4}-4.845411{col 67}{space 3}-3.870029
{txt}{space 10}4  {c |}{col 14}{res}{space 2}-4.844564{col 26}{space 2} .2183774{col 37}{space 1}  -22.18{col 46}{space 3}0.000{col 54}{space 4}-5.272854{col 67}{space 3}-4.416275
{txt}{space 10}5  {c |}{col 14}{res}{space 2}-4.033908{col 26}{space 2} .3662913{col 37}{space 1}  -11.01{col 46}{space 3}0.000{col 54}{space 4} -4.75229{col 67}{space 3}-3.315525
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{p 0 6 0 78}Note: dy/dx for factor levels is the discrete change from the base level.{txt}{p_end}
{res}{txt}
{com}. marginsplot, ///
>   recast(scatter) ///
>   plotop(fcolor(white) lcolor(black) mlabel(_margin) mlabformat(%5.2fc) mlabsize(vsmall)) ///
>   title("") ///
>   xtitle("") ytitle("Government Support") ///
>   xlabel(1 "Strong Out-partisan" 3 "Neutral" 5 "Strong Co-partisan", nogrid) ///
>   ylabel(0 (.5) -3.5, nogrid) ///
>   graphregion(color(white)) ///
>   addplot(hist perp_support if country==0, discrete yaxis(2) yscale(off axis(2)) fcolor(gs10%10) lcolor(black%50 size(small)) legend(off)) name(dk_2)
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:perp_support}{p_end}
{res}{txt}
{com}. 
. *Mexico
. 
. quietly reg support i.treatment##i.perp_support if country == 1 & sample ==1, robust // MX
{txt}
{com}. margins, dydx(treatment) at(perp_support=(1(1)5))
{res}
{txt}{col 1}Conditional marginal effects{col 58}{lalign 13:Number of obs}{col 71} = {res}{ralign 5:1,996}
{txt}{col 1}Model VCE: {res:Robust}

{txt}{p2colset 1 13 13 2}{...}
{p2col:Expression:}{res:Linear prediction, predict()}{p_end}
{p2col:dy/dx wrt:}{res:1.treatment}{p_end}
{p2colreset}{...}
{lalign 7:1._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:1}}
{lalign 7:2._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:2}}
{lalign 7:3._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:3}}
{lalign 7:4._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:4}}
{lalign 7:5._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:5}}

{res}{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26} Delta-method
{col 14}{c |}      dy/dx{col 26}   std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}{res}0.treatment {col 14}{txt}{c |}  (base outcome)
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}1.treatment  {txt}{c |}
{space 9}_at {c |}
{space 10}1  {c |}{col 14}{res}{space 2}-.8441107{col 26}{space 2} .2353525{col 37}{space 1}   -3.59{col 46}{space 3}0.000{col 54}{space 4}-1.305674{col 67}{space 3} -.382547
{txt}{space 10}2  {c |}{col 14}{res}{space 2}-2.054503{col 26}{space 2} .3936454{col 37}{space 1}   -5.22{col 46}{space 3}0.000{col 54}{space 4}-2.826504{col 67}{space 3}-1.282502
{txt}{space 10}3  {c |}{col 14}{res}{space 2}-2.381871{col 26}{space 2} .3080202{col 37}{space 1}   -7.73{col 46}{space 3}0.000{col 54}{space 4}-2.985947{col 67}{space 3}-1.777794
{txt}{space 10}4  {c |}{col 14}{res}{space 2}-2.595271{col 26}{space 2} .3315898{col 37}{space 1}   -7.83{col 46}{space 3}0.000{col 54}{space 4}-3.245571{col 67}{space 3}-1.944971
{txt}{space 10}5  {c |}{col 14}{res}{space 2} -2.62352{col 26}{space 2} .4043798{col 37}{space 1}   -6.49{col 46}{space 3}0.000{col 54}{space 4}-3.416573{col 67}{space 3}-1.830467
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{p 0 6 0 78}Note: dy/dx for factor levels is the discrete change from the base level.{txt}{p_end}
{res}{txt}
{com}. marginsplot, ///
>   recast(scatter) ///
>   plotop(fcolor(white) lcolor(black) mlabel(_margin) mlabformat(%5.2fc) mlabsize(vsmall)) ///
>   title("") ///
>   xtitle("") ytitle("Government Support") ///
>   xlabel(1 "Strong Out-partisan" 3 "Neutral" 5 "Strong Co-partisan", nogrid) ///
>   ylabel(0 (.5) -3.5, nogrid) ///
>   graphregion(color(white)) ///
>   addplot(hist perp_support if country==1, discrete yaxis(2) yscale(off axis(2)) fcolor(gs10%10) lcolor(black%50 size(small)) legend(off)) name(mx_2)
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:perp_support}{p_end}
{res}{txt}
{com}. 
. ***Legitimacy
. *Denmark
. quietly reg legitimacy i.treatment##i.perp_support if country == 0 & sample ==1, robust // DK
{txt}
{com}. margins, dydx(treatment) at(perp_support=(1(1)5))
{res}
{txt}{col 1}Conditional marginal effects{col 58}{lalign 13:Number of obs}{col 71} = {res}{ralign 5:1,880}
{txt}{col 1}Model VCE: {res:Robust}

{txt}{p2colset 1 13 13 2}{...}
{p2col:Expression:}{res:Linear prediction, predict()}{p_end}
{p2col:dy/dx wrt:}{res:1.treatment}{p_end}
{p2colreset}{...}
{lalign 7:1._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:1}}
{lalign 7:2._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:2}}
{lalign 7:3._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:3}}
{lalign 7:4._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:4}}
{lalign 7:5._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:5}}

{res}{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26} Delta-method
{col 14}{c |}      dy/dx{col 26}   std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}{res}0.treatment {col 14}{txt}{c |}  (base outcome)
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}1.treatment  {txt}{c |}
{space 9}_at {c |}
{space 10}1  {c |}{col 14}{res}{space 2}-1.827664{col 26}{space 2} .1901105{col 37}{space 1}   -9.61{col 46}{space 3}0.000{col 54}{space 4}-2.200515{col 67}{space 3}-1.454813
{txt}{space 10}2  {c |}{col 14}{res}{space 2}-2.246661{col 26}{space 2} .1209209{col 37}{space 1}  -18.58{col 46}{space 3}0.000{col 54}{space 4}-2.483815{col 67}{space 3}-2.009507
{txt}{space 10}3  {c |}{col 14}{res}{space 2}-2.311126{col 26}{space 2} .1075719{col 37}{space 1}  -21.48{col 46}{space 3}0.000{col 54}{space 4}-2.522099{col 67}{space 3}-2.100152
{txt}{space 10}4  {c |}{col 14}{res}{space 2}-2.132726{col 26}{space 2} .0902294{col 37}{space 1}  -23.64{col 46}{space 3}0.000{col 54}{space 4}-2.309687{col 67}{space 3}-1.955765
{txt}{space 10}5  {c |}{col 14}{res}{space 2}-1.648277{col 26}{space 2} .1553272{col 37}{space 1}  -10.61{col 46}{space 3}0.000{col 54}{space 4} -1.95291{col 67}{space 3}-1.343644
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{p 0 6 0 78}Note: dy/dx for factor levels is the discrete change from the base level.{txt}{p_end}
{res}{txt}
{com}. marginsplot, ///
>   recast(scatter) ///
>   plotop(fcolor(white) lcolor(black) mlabel(_margin) mlabformat(%5.2fc) mlabsize(vsmall)) ///
>   title("") ///
>   xtitle("") ytitle("Government Legitimacy") ///
>   xlabel(1 "Strong Out-partisan" 3 "Neutral" 5 "Strong Co-partisan", nogrid) ///
>   ylabel(0 (.5) -3.5, nogrid) ///
>   graphregion(color(white)) ///
>   addplot(hist perp_support if country==0, discrete yaxis(2) yscale(off axis(2)) fcolor(gs10%10) lcolor(black%50 size(small)) legend(off)) name(dk_3)
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:perp_support}{p_end}
{res}{txt}
{com}. 
. *Mexico
. quietly reg legitimacy i.treatment##i.perp_support if country == 1 & sample ==1, robust // MX
{txt}
{com}. margins, dydx(treatment) at(perp_support=(1(1)5))
{res}
{txt}{col 1}Conditional marginal effects{col 58}{lalign 13:Number of obs}{col 71} = {res}{ralign 5:1,996}
{txt}{col 1}Model VCE: {res:Robust}

{txt}{p2colset 1 13 13 2}{...}
{p2col:Expression:}{res:Linear prediction, predict()}{p_end}
{p2col:dy/dx wrt:}{res:1.treatment}{p_end}
{p2colreset}{...}
{lalign 7:1._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:1}}
{lalign 7:2._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:2}}
{lalign 7:3._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:3}}
{lalign 7:4._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:4}}
{lalign 7:5._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:5}}

{res}{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26} Delta-method
{col 14}{c |}      dy/dx{col 26}   std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}{res}0.treatment {col 14}{txt}{c |}  (base outcome)
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}1.treatment  {txt}{c |}
{space 9}_at {c |}
{space 10}1  {c |}{col 14}{res}{space 2}-.3604506{col 26}{space 2} .1098219{col 37}{space 1}   -3.28{col 46}{space 3}0.001{col 54}{space 4}-.5758288{col 67}{space 3}-.1450724
{txt}{space 10}2  {c |}{col 14}{res}{space 2}-.8247953{col 26}{space 2} .1541977{col 37}{space 1}   -5.35{col 46}{space 3}0.000{col 54}{space 4}-1.127202{col 67}{space 3}-.5223891
{txt}{space 10}3  {c |}{col 14}{res}{space 2}-.6274379{col 26}{space 2} .1281092{col 37}{space 1}   -4.90{col 46}{space 3}0.000{col 54}{space 4}-.8786804{col 67}{space 3}-.3761955
{txt}{space 10}4  {c |}{col 14}{res}{space 2}-.7571854{col 26}{space 2} .1452918{col 37}{space 1}   -5.21{col 46}{space 3}0.000{col 54}{space 4}-1.042126{col 67}{space 3} -.472245
{txt}{space 10}5  {c |}{col 14}{res}{space 2}-1.052668{col 26}{space 2} .1522085{col 37}{space 1}   -6.92{col 46}{space 3}0.000{col 54}{space 4}-1.351173{col 67}{space 3}-.7541626
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{p 0 6 0 78}Note: dy/dx for factor levels is the discrete change from the base level.{txt}{p_end}
{res}{txt}
{com}. marginsplot, ///
>   recast(scatter) ///
>   plotop(fcolor(white) lcolor(black) mlabel(_margin) mlabformat(%5.2fc) mlabsize(vsmall)) ///
>   title("") ///
>   xtitle("") ytitle("Government Legitimacy") ///
>   xlabel(1 "Strong Out-partisan" 3 "Neutral" 5 "Strong Co-partisan", nogrid) ///
>   ylabel(0 (.5) -3.5, nogrid) ///
>   graphregion(color(white)) ///
>   addplot(hist perp_support if country==1, discrete yaxis(2) yscale(off axis(2)) fcolor(gs10%10) lcolor(black%50 size(small)) legend(off)) name(mx_3)
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:perp_support}{p_end}
{res}{txt}
{com}. 
. ** To generate Figure 2, follow the same steps at with Figure 1 (above). First combine the three graphs for Denmark, then combine the three graphs for Mexico. Finally, combine these "combined" graphs. The hight of the histograms have been squeesed manually and the colorscheme has been changed. 
. 
. graph combine dk_1 dk_2 dk_3, rows(1) name(dk_marg) title("Denmark") 
{res}{txt}
{com}. graph combine mx_1 mx_2 mx_3, rows(1) name(mx_marg) title("Mexico") 
{res}{txt}
{com}. graph combine dk_marg mx_marg, rows(2) name(fig2) plotregion(lcolor(black) lwidth(medium))
{res}{txt}
{com}. 
. graph drop dk_1 dk_2 dk_3 mx_1 mx_2 mx_3 dk_marg mx_marg
{txt}
{com}. 
. *** FIGURE 3
. ** Please note that the dotted line is taken from margins output (it correspond to the predicted margin for strong co-partisans). 
. 
. *** DENMARK
. *Support
. quietly reg support i.treatment##i.perp_support if country == 0 & sample==1, robust // DK
{txt}
{com}. margins treatment, at(perp_support=(1(1)5))
{res}
{txt}{col 1}Adjusted predictions{col 58}{lalign 13:Number of obs}{col 71} = {res}{ralign 5:1,880}
{txt}{col 1}Model VCE: {res:Robust}

{txt}{p2colset 1 13 13 2}{...}
{p2col:Expression:}{res:Linear prediction, predict()}{p_end}
{p2colreset}{...}
{lalign 7:1._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:1}}
{lalign 7:2._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:2}}
{lalign 7:3._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:3}}
{lalign 7:4._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:4}}
{lalign 7:5._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:5}}

{res}{txt}{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27} Delta-method
{col 15}{c |}     Margin{col 27}   std. err.{col 39}      t{col 47}   P>|t|{col 55}     [95% con{col 68}f. interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
_at#treatment {c |}
{space 3}1#Control  {c |}{col 15}{res}{space 2} 1.380952{col 27}{space 2} .2570508{col 38}{space 1}    5.37{col 47}{space 3}0.000{col 55}{space 4} .8768158{col 68}{space 3} 1.885089
{txt}{space 3}1#Treated  {c |}{col 15}{res}{space 2} .5469388{col 27}{space 2} .1004723{col 38}{space 1}    5.44{col 47}{space 3}0.000{col 55}{space 4} .3498892{col 68}{space 3} .7439884
{txt}{space 3}2#Control  {c |}{col 15}{res}{space 2} 3.742857{col 27}{space 2} .2343083{col 38}{space 1}   15.97{col 47}{space 3}0.000{col 55}{space 4} 3.283324{col 68}{space 3}  4.20239
{txt}{space 3}2#Treated  {c |}{col 15}{res}{space 2} .7256098{col 27}{space 2} .0809539{col 38}{space 1}    8.96{col 47}{space 3}0.000{col 55}{space 4} .5668403{col 68}{space 3} .8843792
{txt}{space 3}3#Control  {c |}{col 15}{res}{space 2} 5.829787{col 27}{space 2} .2225425{col 38}{space 1}   26.20{col 47}{space 3}0.000{col 55}{space 4} 5.393329{col 68}{space 3} 6.266245
{txt}{space 3}3#Treated  {c |}{col 15}{res}{space 2} 1.472067{col 27}{space 2} .1109474{col 38}{space 1}   13.27{col 47}{space 3}0.000{col 55}{space 4} 1.254473{col 68}{space 3} 1.689661
{txt}{space 3}4#Control  {c |}{col 15}{res}{space 2} 7.584746{col 27}{space 2} .1586619{col 38}{space 1}   47.80{col 47}{space 3}0.000{col 55}{space 4} 7.273573{col 68}{space 3} 7.895919
{txt}{space 3}4#Treated  {c |}{col 15}{res}{space 2} 2.740181{col 27}{space 2} .1500503{col 38}{space 1}   18.26{col 47}{space 3}0.000{col 55}{space 4} 2.445898{col 68}{space 3} 3.034465
{txt}{space 3}5#Control  {c |}{col 15}{res}{space 2} 8.403226{col 27}{space 2} .2468137{col 38}{space 1}   34.05{col 47}{space 3}0.000{col 55}{space 4} 7.919167{col 68}{space 3} 8.887285
{txt}{space 3}5#Treated  {c |}{col 15}{res}{space 2} 4.369318{col 27}{space 2} .2706517{col 38}{space 1}   16.14{col 47}{space 3}0.000{col 55}{space 4} 3.838507{col 68}{space 3} 4.900129
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. marginsplot, ///
>   recast(scatter) ///
>   plotop(fcolor(white) lcolor(black) mlabel(_margin) mlabformat(%5.2fc) mlabsize(vsmall)) ///
>   title("") ///
>   xtitle("") ytitle("Government Support") ///
>   xlabel(1 "Strong Out-partisan" 3 "Neutral" 5 "Strong Co-partisan", nogrid) ///
>   ylabel(0 (1) 10, nogrid) ///
>   yline(4.369318) ///
>   graphregion(color(white)) ///
>   addplot(hist perp_support if country==0, discrete yaxis(2) yscale(off axis(2)) fcolor(gs10%10) lcolor(black%50 size(small)) legend(off)) name(dk_1)
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:perp_support treatment}{p_end}
{res}{txt}
{com}. 
. *Legitimacy  
. quietly reg legitimacy i.treatment##i.perp_support if country == 0 & sample==1, robust // DK
{txt}
{com}. margins treatment, at(perp_support=(1(1)5))
{res}
{txt}{col 1}Adjusted predictions{col 58}{lalign 13:Number of obs}{col 71} = {res}{ralign 5:1,880}
{txt}{col 1}Model VCE: {res:Robust}

{txt}{p2colset 1 13 13 2}{...}
{p2col:Expression:}{res:Linear prediction, predict()}{p_end}
{p2colreset}{...}
{lalign 7:1._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:1}}
{lalign 7:2._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:2}}
{lalign 7:3._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:3}}
{lalign 7:4._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:4}}
{lalign 7:5._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:5}}

{res}{txt}{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27} Delta-method
{col 15}{c |}     Margin{col 27}   std. err.{col 39}      t{col 47}   P>|t|{col 55}     [95% con{col 68}f. interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
_at#treatment {c |}
{space 3}1#Control  {c |}{col 15}{res}{space 2} 3.174603{col 27}{space 2} .1822153{col 38}{space 1}   17.42{col 47}{space 3}0.000{col 55}{space 4} 2.817237{col 68}{space 3}  3.53197
{txt}{space 3}1#Treated  {c |}{col 15}{res}{space 2} 1.346939{col 27}{space 2}  .054218{col 38}{space 1}   24.84{col 47}{space 3}0.000{col 55}{space 4} 1.240605{col 68}{space 3} 1.453273
{txt}{space 3}2#Control  {c |}{col 15}{res}{space 2} 3.761905{col 27}{space 2} .1093159{col 38}{space 1}   34.41{col 47}{space 3}0.000{col 55}{space 4} 3.547511{col 68}{space 3} 3.976299
{txt}{space 3}2#Treated  {c |}{col 15}{res}{space 2} 1.515244{col 27}{space 2} .0516903{col 38}{space 1}   29.31{col 47}{space 3}0.000{col 55}{space 4} 1.413867{col 68}{space 3} 1.616621
{txt}{space 3}3#Control  {c |}{col 15}{res}{space 2} 3.978723{col 27}{space 2} .0929641{col 38}{space 1}   42.80{col 47}{space 3}0.000{col 55}{space 4} 3.796399{col 68}{space 3} 4.161048
{txt}{space 3}3#Treated  {c |}{col 15}{res}{space 2} 1.667598{col 27}{space 2} .0541238{col 38}{space 1}   30.81{col 47}{space 3}0.000{col 55}{space 4} 1.561448{col 68}{space 3} 1.773747
{txt}{space 3}4#Control  {c |}{col 15}{res}{space 2} 4.220339{col 27}{space 2}  .063741{col 38}{space 1}   66.21{col 47}{space 3}0.000{col 55}{space 4} 4.095328{col 68}{space 3}  4.34535
{txt}{space 3}4#Treated  {c |}{col 15}{res}{space 2} 2.087613{col 27}{space 2} .0638625{col 38}{space 1}   32.69{col 47}{space 3}0.000{col 55}{space 4} 1.962364{col 68}{space 3} 2.212863
{txt}{space 3}5#Control  {c |}{col 15}{res}{space 2} 4.290323{col 27}{space 2} .1106037{col 38}{space 1}   38.79{col 47}{space 3}0.000{col 55}{space 4} 4.073403{col 68}{space 3} 4.507242
{txt}{space 3}5#Treated  {c |}{col 15}{res}{space 2} 2.642045{col 27}{space 2} .1090566{col 38}{space 1}   24.23{col 47}{space 3}0.000{col 55}{space 4}  2.42816{col 68}{space 3} 2.855931
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. marginsplot, ///
>   recast(scatter) ///
>   plotop(fcolor(white) lcolor(black) mlabel(_margin) mlabformat(%5.2fc) mlabsize(vsmall)) ///
>   title("") ///
>   xtitle("") ytitle("Government Legitimacy") ///
>   xlabel(1 "Strong Out-partisan" 3 "Neutral" 5 "Strong Co-partisan", nogrid) ///
>   ylabel(0 (1) 10, nogrid) ///
>   yline(2.642045) ///
>   graphregion(color(white)) ///
>   addplot(hist perp_support if country==0, discrete yaxis(2) yscale(off axis(2)) fcolor(gs10%10) lcolor(black%50 size(small)) legend(off)) name(dk_2)
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:perp_support treatment}{p_end}
{res}{txt}
{com}. 
. *graph combine "CDIRECTORY" "DIRECTORY", rows(1)
.   
. *** MEXICO
. *Support  
. quietly reg support i.treatment##i.perp_support if country == 1 & sample==1, robust // MEX
{txt}
{com}. margins treatment, at(perp_support=(1(1)5))
{res}
{txt}{col 1}Adjusted predictions{col 58}{lalign 13:Number of obs}{col 71} = {res}{ralign 5:1,996}
{txt}{col 1}Model VCE: {res:Robust}

{txt}{p2colset 1 13 13 2}{...}
{p2col:Expression:}{res:Linear prediction, predict()}{p_end}
{p2colreset}{...}
{lalign 7:1._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:1}}
{lalign 7:2._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:2}}
{lalign 7:3._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:3}}
{lalign 7:4._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:4}}
{lalign 7:5._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:5}}

{res}{txt}{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27} Delta-method
{col 15}{c |}     Margin{col 27}   std. err.{col 39}      t{col 47}   P>|t|{col 55}     [95% con{col 68}f. interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
_at#treatment {c |}
{space 3}1#Control  {c |}{col 15}{res}{space 2} 2.095745{col 27}{space 2}  .213186{col 38}{space 1}    9.83{col 47}{space 3}0.000{col 55}{space 4} 1.677653{col 68}{space 3} 2.513836
{txt}{space 3}1#Treated  {c |}{col 15}{res}{space 2} 1.251634{col 27}{space 2} .0997121{col 38}{space 1}   12.55{col 47}{space 3}0.000{col 55}{space 4} 1.056083{col 68}{space 3} 1.447185
{txt}{space 3}2#Control  {c |}{col 15}{res}{space 2} 4.245614{col 27}{space 2} .3528839{col 38}{space 1}   12.03{col 47}{space 3}0.000{col 55}{space 4} 3.553553{col 68}{space 3} 4.937676
{txt}{space 3}2#Treated  {c |}{col 15}{res}{space 2} 2.191111{col 27}{space 2} .1744409{col 38}{space 1}   12.56{col 47}{space 3}0.000{col 55}{space 4} 1.849005{col 68}{space 3} 2.533218
{txt}{space 3}3#Control  {c |}{col 15}{res}{space 2} 5.552083{col 27}{space 2} .2544588{col 38}{space 1}   21.82{col 47}{space 3}0.000{col 55}{space 4} 5.053049{col 68}{space 3} 6.051117
{txt}{space 3}3#Treated  {c |}{col 15}{res}{space 2} 3.170213{col 27}{space 2} .1735718{col 38}{space 1}   18.26{col 47}{space 3}0.000{col 55}{space 4} 2.829811{col 68}{space 3} 3.510615
{txt}{space 3}4#Control  {c |}{col 15}{res}{space 2} 7.036585{col 27}{space 2} .2496248{col 38}{space 1}   28.19{col 47}{space 3}0.000{col 55}{space 4} 6.547031{col 68}{space 3} 7.526139
{txt}{space 3}4#Treated  {c |}{col 15}{res}{space 2} 4.441315{col 27}{space 2} .2182642{col 38}{space 1}   20.35{col 47}{space 3}0.000{col 55}{space 4} 4.013264{col 68}{space 3} 4.869365
{txt}{space 3}5#Control  {c |}{col 15}{res}{space 2} 8.537313{col 27}{space 2} .2934624{col 38}{space 1}   29.09{col 47}{space 3}0.000{col 55}{space 4} 7.961787{col 68}{space 3}  9.11284
{txt}{space 3}5#Treated  {c |}{col 15}{res}{space 2} 5.913793{col 27}{space 2} .2782136{col 38}{space 1}   21.26{col 47}{space 3}0.000{col 55}{space 4} 5.368172{col 68}{space 3} 6.459414
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. marginsplot, ///
>   recast(scatter) ///
>   plotop(fcolor(white) lcolor(black) mlabel(_margin) mlabformat(%5.2fc) mlabsize(vsmall)) ///
>   title("") ///
>   xtitle("") ytitle("Government Support") ///
>   xlabel(1 "Strong Out-partisan" 3 "Neutral" 5 "Strong Co-partisan", nogrid) ///
>   ylabel(0 (1) 10, nogrid) ///
>   yline(5.913793) ///
>   graphregion(color(white)) ///
>   addplot(hist perp_support if country==1, discrete yaxis(2) yscale(off axis(2)) fcolor(gs10%10) lcolor(black%50 size(small))) name(mx_1)
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:perp_support treatment}{p_end}
{res}{txt}
{com}. 
. 
. *Legitimacy
. quietly reg legitimacy i.treatment##i.perp_support if country == 1 & sample==1, robust // DK
{txt}
{com}. margins treatment, at(perp_support=(1(1)5))
{res}
{txt}{col 1}Adjusted predictions{col 58}{lalign 13:Number of obs}{col 71} = {res}{ralign 5:1,996}
{txt}{col 1}Model VCE: {res:Robust}

{txt}{p2colset 1 13 13 2}{...}
{p2col:Expression:}{res:Linear prediction, predict()}{p_end}
{p2colreset}{...}
{lalign 7:1._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:1}}
{lalign 7:2._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:2}}
{lalign 7:3._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:3}}
{lalign 7:4._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:4}}
{lalign 7:5._at: }{space 0}{lalign 12:perp_support} = {res:{ralign 1:5}}

{res}{txt}{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27} Delta-method
{col 15}{c |}     Margin{col 27}   std. err.{col 39}      t{col 47}   P>|t|{col 55}     [95% con{col 68}f. interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
_at#treatment {c |}
{space 3}1#Control  {c |}{col 15}{res}{space 2} 2.345745{col 27}{space 2} .0972402{col 38}{space 1}   24.12{col 47}{space 3}0.000{col 55}{space 4} 2.155041{col 68}{space 3} 2.536448
{txt}{space 3}1#Treated  {c |}{col 15}{res}{space 2} 1.985294{col 27}{space 2}  .051041{col 38}{space 1}   38.90{col 47}{space 3}0.000{col 55}{space 4} 1.885195{col 68}{space 3} 2.085394
{txt}{space 3}2#Control  {c |}{col 15}{res}{space 2} 3.140351{col 27}{space 2} .1302902{col 38}{space 1}   24.10{col 47}{space 3}0.000{col 55}{space 4} 2.884831{col 68}{space 3} 3.395871
{txt}{space 3}2#Treated  {c |}{col 15}{res}{space 2} 2.315556{col 27}{space 2} .0824706{col 38}{space 1}   28.08{col 47}{space 3}0.000{col 55}{space 4} 2.153818{col 68}{space 3} 2.477293
{txt}{space 3}3#Control  {c |}{col 15}{res}{space 2} 3.177083{col 27}{space 2} .1044232{col 38}{space 1}   30.43{col 47}{space 3}0.000{col 55}{space 4} 2.972293{col 68}{space 3} 3.381874
{txt}{space 3}3#Treated  {c |}{col 15}{res}{space 2} 2.549645{col 27}{space 2} .0742143{col 38}{space 1}   34.36{col 47}{space 3}0.000{col 55}{space 4} 2.404099{col 68}{space 3} 2.695191
{txt}{space 3}4#Control  {c |}{col 15}{res}{space 2} 3.597561{col 27}{space 2} .1183564{col 38}{space 1}   30.40{col 47}{space 3}0.000{col 55}{space 4} 3.365445{col 68}{space 3} 3.829677
{txt}{space 3}4#Treated  {c |}{col 15}{res}{space 2} 2.840376{col 27}{space 2} .0842703{col 38}{space 1}   33.71{col 47}{space 3}0.000{col 55}{space 4} 2.675108{col 68}{space 3} 3.005643
{txt}{space 3}5#Control  {c |}{col 15}{res}{space 2} 4.179104{col 27}{space 2} .1118228{col 38}{space 1}   37.37{col 47}{space 3}0.000{col 55}{space 4} 3.959802{col 68}{space 3} 4.398407
{txt}{space 3}5#Treated  {c |}{col 15}{res}{space 2} 3.126437{col 27}{space 2} .1032623{col 38}{space 1}   30.28{col 47}{space 3}0.000{col 55}{space 4} 2.923923{col 68}{space 3} 3.328951
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}. marginsplot, ///
>   recast(scatter) ///
>   plotop(fcolor(white) lcolor(black) mlabel(_margin) mlabformat(%5.2fc) mlabsize(vsmall)) ///
>   title("") ///
>   xtitle("") ytitle("Government Legitimacy") ///
>   xlabel(1 "Strong Out-partisan" 3 "Neutral" 5 "Strong Co-partisan", nogrid) ///
>   ylabel(0 (1) 10, nogrid) ///
>   yline(3.126437) ///
>   graphregion(color(white)) ///
>   addplot(hist perp_support if country==1, discrete yaxis(2) yscale(off axis(2)) fcolor(gs10%10) lcolor(black%50 size(small))) name(mx_2)
{res}
{text}{p 0 0 2}Variables that uniquely identify margins: {bf:perp_support treatment}{p_end}
{res}{txt}
{com}. 
. 
.   
. ** To generate Figure 3, follow the same steps at with Figure 1 and Figure 2 (above). First combine the two graphs for Denmark, then combine the two graphs for Mexico. Finally, combine these "combined" graphs. The hight of the histograms have been squeesed manually and the colorscheme has been changed.  
. graph combine dk_1 dk_2, rows(1) name(dk_marg) title("Denmark") 
{res}{txt}
{com}. graph combine mx_1 mx_2, rows(1) name(mx_marg) title("Mexico") 
{res}{txt}
{com}. graph combine dk_marg mx_marg, rows(2) name(fig3) plotregion(lcolor(black) lwidth(medium))
{res}{txt}
{com}. 
{txt}end of do-file

{com}. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\au448989\OneDrive - Aarhus Universitet\Projekter\Submissions\Electoral Malpractice, Partisanship, and Attitudes\Revision_BJPS\Revision No. 2\Replication files\analysis_log.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}23 Feb 2022, 14:47:35
{txt}{.-}
{smcl}
{txt}{sf}{ul off}